import type { R, P } from '@/type/base'
import shopList from '@/mock/shoplist.json'
import { request } from '@/utils/request'

export const createOrder = async (data: Object): R<Object> => {
  return await request({
    path: '/buyer/order/create/qr',
    method: 'POST',
    data,
    options: {
      hideLoading: true,
    },
  })
}

export const queryOrderResult = async (orderId: string): R<Object> => {
  return await request({
    path: '/buyer/order/query/pay/result',
    method: 'GET',
    data: {
      orderId,
    },
    options: {},
  })
}

export const getUserOrderPageList = async (data: Object): R<Object> => {
  return await request({
    path: '/buyer/order/page/list',
    method: 'GET',
    data,
    options: {
      hideLoading: true,
    },
  })
}
